package com.ny.demo0428;

class HomeInsurance extends Insurance {
    private double homeValue; // 房屋价值
    private double area;     // 房屋面积

    public HomeInsurance(double homeValue, double area) {
        this.homeValue = homeValue;
        this.area = area;
    }

    @Override
    public double calculatePremium() {
        double basePremium = homeValue * 0.015; // 基础保费（1.5%）
        if (area > 100) {
            return basePremium * 1.05; // 面积>100㎡时增加5%
        } else {
            return basePremium;
        }
    }
}